-- GENERATED SPELL FOR [Bithrus] --


function spell0_16650(pUnit, Event) --@Blue Firework,Self--
pUnit:FullCastSpellOnTarget(11540,pUnit)
pUnit:RegisterEvent('Sorts_16650', 618, 1)
end

function spell1_16650(pUnit, Event) --@Green Firework,Self--
pUnit:FullCastSpellOnTarget(11541,pUnit)
pUnit:RegisterEvent('Sorts_16650', 574, 1)
end

function spell2_16650(pUnit, Event) --@Purple Firework,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(30161,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_16650', 1, 1)
end

function spell3_16650(pUnit, Event) --@Red Streaks Firework,Self--
pUnit:FullCastSpellOnTarget(11542,pUnit)
pUnit:RegisterEvent('Sorts_16650', 587, 1)
end

function spell4_16650(pUnit, Event) --@Yellow Rose Firework,Self--
pUnit:FullCastSpellOnTarget(11544,pUnit)
pUnit:RegisterEvent('Sorts_16650', 642, 1)
end

function Sorts_16650(pUnit, Event)
local choix_sorts_16650 = math.random(0, 4)
if choix_sorts_16650 == 0 then
pUnit:RegisterEvent('spell0_16650', 1, 1)
end
if choix_sorts_16650 == 1 then
pUnit:RegisterEvent('spell1_16650', 1, 1)
end
if choix_sorts_16650 == 2 then
pUnit:RegisterEvent('spell2_16650', 1, 1)
end
if choix_sorts_16650 == 3 then
pUnit:RegisterEvent('spell3_16650', 1, 1)
end
if choix_sorts_16650 == 4 then
pUnit:RegisterEvent('spell4_16650', 1, 1)
end
end

function mob16650_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16650', math.random(1500, 3000), 1)
end

function mob16650_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16650_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16650_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16650, 1, 'mob16650_Action')
RegisterUnitEvent(16650, 2, 'mob16650_Leave')
RegisterUnitEvent(16650, 3, 'mob16650_Kill')
RegisterUnitEvent(16650, 4, 'mob16650_Die')
